package com.koron.standard.deviceClasssify.service;

import com.koron.standard.deviceClasssify.enums.TypeRef;
import com.koron.standard.jobStock.experiment.service.ExperimentService;
import com.koron.standard.jobStock.maintain.service.MaintainService;
import com.koron.standard.jobStock.overhaul.service.OverhaulService;
import com.koron.standard.jobStock.repair.service.RepairService;
import com.koron.standard.patrol.service.PatrolService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author jzp
 * @since 2022/2/16
 */
@Service
@RequiredArgsConstructor
public class StandardService {
    private final MaintainService maintainService;
    private final OverhaulService overhaulService;
    private final RepairService repairService;
    private final ExperimentService experimentService;
    private final PatrolService patrolService;

    public List<String> filterStandard(List<String> typeIds, String refType) {
        // 正常维护
        if (TypeRef.MAINTAIN.equals(refType)) {
            return maintainService.filterTypeIds(typeIds);
        } else if (TypeRef.OVERHAUL.equals(refType)) {
            return overhaulService.filterTypeIds(typeIds);
        } else if (TypeRef.REPAIR.equals(refType)) {
            return repairService.filterTypeIds(typeIds);
        } else if (TypeRef.EXPERIMENT.equals(refType)) {
            return experimentService.filterTypeIds(typeIds);
        } else if (TypeRef.PATROL.equals(refType)) {
            return patrolService.filterTypeIds(typeIds);
        }
        return null;
    }
}
